package com.tiancheng.onecode.exception;

/**
 * @Author: kellen
 * @Description:
 * @Date: create in 2024/12/10 09:46
 */
public class ErrorCodeException extends RuntimeException {
    private final int errorCode;
    private Object data;

    public ErrorCodeException() {
        this.errorCode = 500;
    }

    public ErrorCodeException(Object data) {
        this.errorCode = 500;
        this.data = data;
    }

    public ErrorCodeException(String message) {
        super(message);
        this.errorCode = 500;
    }

    public ErrorCodeException(String message, Object data) {
        super(message);
        this.errorCode = 500;
        this.data = data;
    }

    public ErrorCodeException(int errorCode) {
        this.errorCode = errorCode;
    }

    public ErrorCodeException(int errorCode, Object data) {
        this.errorCode = errorCode;
        this.data = data;
    }

    public ErrorCodeException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public ErrorCodeException(int errorCode, String message, Object data) {
        super(message);
        this.errorCode = errorCode;
        this.data = data;
    }

    public ErrorCodeException(int errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public ErrorCodeException(int errorCode, String message, Object data, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.data = data;
    }

    public ErrorCodeException(int errorCode, Throwable cause) {
        super(cause);
        this.errorCode = errorCode;
    }

    public ErrorCodeException(int errorCode, Object data, Throwable cause) {
        super(cause);
        this.errorCode = errorCode;
        this.data = data;
    }

    public ErrorCodeException(int errorCode, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
    }

    public ErrorCodeException(int errorCode, String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Object data) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
        this.data = data;
    }

    public int getErrorCode() {
        return this.errorCode;
    }

    public Object getData() {
        return this.data;
    }
}
